<?php
session_start();
?>
<html>
<head>
<link rel="stylesheet" href="style.css" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<title>sans titre 1</title>
</head>

<body>

	<div id="container">
		<div id="top">
			<?php include 'header.php'; ?>
		</div>
			
		<div id="leftnav">
			<?php include 'menu.php'; ?>
		</div>
	
		<div id="content">
			<?php
			try
			{
			include 'include/Data.php';
			$ContenuCommentaire = $_POST['ContenuCommentaire'];
			$NumUtilisateur = $_SESSION['NumUtilisateur'];
			$NumArticle = $_POST['NumArticle'];
			

		$Annee = strftime("%Y");
		$Moisnum = strftime("%m");
		$Jour = strftime("%d");
		$Date = "$Annee-$Moisnum-$Jour";
			
			$r = "INSERT INTO commentaire (DateCommentaire, ApprouveCommentaire, ContenuCommentaire, NumUtilisateur, NumArticle) VALUES ('".$Date."', 1,'".$ContenuCommentaire."','".$NumUtilisateur."', '".$NumArticle."');";
			$req = mysql_query($r,$connexion);	
				
			echo 'Commentaire bien ajouté !';
			mysql_close($connexion);
			}
			catch(Exception $e)
			{
			die('Erreur : '.$e->getMessage());
			}
			?>
		</div>
		
		<div id="footer">
		<?php include 'footer.php'; ?>
		</div>
 	
	</div>
</body>
</html>